export default (_self, h) => {
	return h(
		"el-select",
		{
			props: {
				value: _self.obj.value,
				clearable: true,
				placeholder: _self.obj.placeholder,
			},
			attrs: {
				disabled: !_self.obj.status,
			},
			on: {
				change: e => {
					_self.obj.value = e;
				},
				clear: () => {
					_self.obj.value = "";
				},
			},
		},
		_self.obj.detailList.map(v => {
			return h(
				"el-option",
				{
					props: {
						label: v.label,
						value: v.value,
					},
				},
				v.label
			);
		})
	);
};

export const selectConf = {
	status: true, // 启用状态，true启用；0停用
	elementWidth: "100%",
	elementType: "select", // 对应数据库内类型
	elementName: "单选下拉框", // 控件左侧label内容
	placeholder: "请选择",
	value: "", // 绑定的值
	detailList: [
		// 选项内数据
		{
			key: 0,
			label: "选项框1",
			value: "选项框1",
		},
		{
			key: 1,
			label: "选项框2",
			value: "选项框2",
		},
	],
	key: 2, // 配置的起始key
	icon: "el-icon-arrow-down",
	required: false,
	rules: [],
};
